package com.hxht.storage.server.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hxht.storage.server.bean.PlanRecordBean;
import com.hxht.storage.server.bean.RecordStopBean;
import com.hxht.storage.server.service.PlanRecordService;


@Controller
@RequestMapping("/plan")
public class PlanRecordController {

	
	@Autowired
	private PlanRecordService recordService;
	
	@RequestMapping(value= "/", method = RequestMethod.POST)
	@ResponseBody
	public Boolean startRecord(@RequestBody PlanRecordBean recordBean){
		
		boolean result = recordService.startRecord(recordBean);
		
		return result;
	}
	
	@RequestMapping(value= "/", method = RequestMethod.PUT)
//	@ResponseBody
	public void stopRecord(@RequestBody RecordStopBean stopBean){
		
		recordService.stopRecord(stopBean);
	}
	
}
